/*
 * BarDaoHibernate.java
 *
 * Created on 4 de noviembre de 2006, 13:09
 *
 */

package cheers.orm.dao.hibernate;

import java.util.List;
import cheers.orm.dao.IBarDAO;
import cheers.model.Bar;

/**
 *
 * @author Santiago Hirschfeld
 */
public class BarDAOHibernate extends BaseDAOHibernate implements IBarDAO {
    
    public Bar getBar(int id) {
        return (Bar)getHibernateTemplate().load(Bar.class,new Integer(id));
    }

    public List<Bar> getAllBars() {
        return getHibernateTemplate().find("from Bar");
    }

    public void saveBar(Bar bar) {
        getHibernateTemplate().saveOrUpdate(bar);
    }

    public void removeBar(Bar bar) {
        getHibernateTemplate().delete(bar);
    }
}
